home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Compilers⁄Interps / GCC-2.3.3r12 / Misc / configure < prev    next >
Encoding:
Text File  |  1993-04-06  |  29.2 KB  |  1,345 lines  |  [TEXT/MPS ]

  1. #!/bin/sh
  2. # Configuration script for GNU CC
  3. #   Copyright (C) 1988, 1990, 1991, 1992 Free Software Foundation, Inc.
  4.  
  5. #This file is part of GNU CC.
  6.  
  7. #GNU CC is free software; you can redistribute it and/or modify
  8. #it under the terms of the GNU General Public License as published by
  9. #the Free Software Foundation; either version 2, or (at your option)
  10. #any later version.
  11.  
  12. #GNU CC is distributed in the hope that it will be useful,
  13. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. #GNU General Public License for more details.
  16.  
  17. #You should have received a copy of the GNU General Public License
  18. #along with GNU CC; see the file COPYING.  If not, write to
  19. #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. #
  22. # Shell script to create proper links to machine-dependent files in
  23. # preparation for compiling gcc.
  24. #
  25. # Options: --srcdir=DIR        specifies directory where sources are.
  26. #        --host=HOST        specifies host configuration.
  27. #       --target=TARGET    specifies target configuration.
  28. #       --build=TARGET    specifies configuration of machine you are
  29. #                using to compile GCC.
  30. #       --prefix=DIR        specifies directory to install in.
  31. #       --exec-prefix=DIR    specifies directory to install executables in.
  32. #       --with-gnu-ld    arrange to work with GNU ld.
  33. #       --with-gnu-as    arrange to work with GAS.
  34. #       --with-stabs        arrange to use stabs instead of host debug format.
  35. #       --nfp        assume system has no FPU.
  36. #
  37. # If configure succeeds, it leaves its status in config.status.
  38. # If configure fails after disturbing the status quo, 
  39. #     config.status is removed.
  40. #
  41.  
  42. progname=$0
  43.  
  44. # Default --srcdir to the directory where the script is found, 
  45. # if a directory was specified.
  46. # The second sed call is to convert `.//configure' to `./configure'.
  47. srcdir=`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`
  48. if [ x$srcdir = x$0 ]
  49. then
  50. srcdir=
  51. fi
  52.  
  53. host=
  54.  
  55. # Default prefix to /usr/local.
  56. prefix=/usr/local
  57. # Default is to let the Makefile set exec_prefix from $(prefix)
  58. exec_prefix='$(prefix)'
  59.  
  60. remove=rm
  61. hard_link=ln
  62. symbolic_link='ln -s'
  63. copy=cp
  64.  
  65. # Record all the arguments, to write them in config.status.
  66. arguments=$*
  67.  
  68. #for Test
  69. #remove="echo rm"
  70. #hard_link="echo ln"
  71. #symbolic_link="echo ln -s"
  72.  
  73. target=
  74. host=
  75. build=
  76.  
  77. for arg in $*;
  78. do
  79.   case $next_arg in
  80.   --srcdir)
  81.     srcdir=$arg
  82.     next_arg=
  83.     ;;
  84.   --host)
  85.     host=$arg
  86.     next_arg=
  87.     ;;
  88.   --target)
  89.     target=$arg
  90.     next_arg=
  91.     ;;
  92.   --build)
  93.     build=$arg
  94.     next_arg=
  95.     ;;
  96.   --prefix)
  97.     prefix=$arg
  98.     next_arg=
  99.     ;;
  100.   --exec-prefix)
  101.     exec_prefix=$arg
  102.     next_arg=
  103.     ;;
  104.   *)
  105.     case $arg in
  106.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  107.     next_arg=--srcdir
  108.     ;;
  109.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  110.     srcdir=`echo $arg | sed 's/-*s[a-z]*=//'`
  111.     ;;
  112.      -host | --host | --hos | --ho | --h)
  113.     next_arg=--host
  114.     ;;
  115.      -host=* | --host=* | --hos=* | --ho=* | --h=*)
  116.     host=`echo $arg | sed 's/-*h[a-z]*=//'`
  117.     ;; 
  118.      -target | --target | --targe | --targ | --tar | --ta | --t)
  119.     next_arg=--target
  120.     ;;
  121.      -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  122.     target=`echo $arg | sed 's/-*t[a-z]*=//'`
  123.     ;; 
  124.      -build | --build | --buil | --bui | --bu | --b)
  125.     next_arg=--build
  126.     ;;
  127.      -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
  128.     build=`echo $arg | sed 's/-*b[a-z]*=//'`
  129.     ;; 
  130.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  131.     next_arg=--prefix
  132.     ;;
  133.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  134.     prefix=`echo $arg | sed 's/-*p[a-z]*=//'`
  135.     ;;
  136.      -exec-prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre \
  137.     | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  138.     next_arg=--exec-prefix
  139.     ;;
  140.      -exec-prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* \
  141.     | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* \
  142.     | --exe=* | --ex=* | --e=*)
  143.     exec_prefix=`echo $arg | sed 's/-*e[-a-z]*=//'`
  144.     ;;
  145.      -with-gnu-ld | --with-gnu-ld | --with-gnu-l)
  146.     gnu_ld=yes
  147.     ;;
  148.      -gas | --gas | --ga | --g | -with-gnu-as | --with-gnu-as | -with-gnu-a)
  149.         gas=yes
  150.     ;;
  151.      -nfp | --nfp | --nf | --n)
  152.     nfp=yes
  153.     ;;
  154.      -with-stabs | -with-stab | -with-sta | -with-st | -with-s \
  155.     | --with-stabs | --with-stab | --with-sta | --with-st | --with-s \
  156.     | -stabs | -stab | -sta | -st  \
  157.     | --stabs | --stab | --sta | --st)
  158.     stabs=yes
  159.     ;;
  160.      -with-* | --with-*) ;; #ignored
  161.      -x | --x) ;; # ignored
  162.      -*)
  163.     echo "Invalid option \`$arg'" 1>&2
  164.     exit 1
  165.     ;;
  166.      *)
  167. # Allow configure HOST TARGET
  168.     if [ x$host = x ]
  169.     then
  170.         host=$target
  171.     fi
  172.     target=$arg
  173.     ;;
  174.     esac
  175.   esac
  176. done
  177.  
  178. # Find the source files, if location was not specified.
  179. if [ x$srcdir = x ]
  180. then
  181.     srcdirdefaulted=1
  182.     srcdir=.
  183.     if [ ! -r tree.c ]
  184.     then
  185.         srcdir=..
  186.     fi
  187. fi
  188.  
  189. if [ ! -r ${srcdir}/tree.c ]
  190. then
  191.     if [ x$srcdirdefaulted = x ]
  192.     then
  193.       echo "$progname: Can't find compiler sources in \`${srcdir}'" 1>&2
  194.     else
  195.       echo "$progname: Can't find compiler sources in \`.' or \`..'" 1>&2
  196.     fi
  197.     exit 1
  198. fi
  199.  
  200. if [ -r ${srcdir}/config.status ] && [ x$srcdir != x. ]
  201. then
  202.     echo "$progname: \`configure' has been run in \`${srcdir}'" 1>&2
  203.     exit 1
  204. fi
  205.  
  206. # Complain if an arg is missing
  207. if [ x$target = x ]
  208. then
  209.     echo "No target specified." 1>&2
  210.  
  211.     echo "\
  212. Usage: `basename $progname` [--host=HOST] [--build=BUILD]
  213.        [--prefix=DIR] [--exec-pref=DIR]
  214.        [--with-gnu-as] [--with-gnu-ld] [--with-stabs] [--nfp] TARGET" 1>&2
  215.     echo "Where HOST, TARGET and BUILD are three-part configuration names " 1>&2
  216.     if [ -r config.status ]
  217.     then
  218.         tail +2 config.status 1>&2
  219.     fi
  220.     exit 1
  221. fi
  222.  
  223. # Default other arg
  224. if [ x$host = x ]
  225. then
  226.     host=$target
  227. fi
  228. # If $build was not specified, use $host.
  229. if [ x$build = x ]
  230. then
  231.     build=$host
  232. fi
  233.  
  234. build_xm_file=
  235. host_xm_file=
  236. host_xmake_file=
  237. host_broken_install=
  238.  
  239. # Validate the specs, and canonicalize them.
  240. canon_build=`$srcdir/config.sub $build` || exit 1
  241. canon_host=`$srcdir/config.sub $host` || exit 1
  242. canon_target=`$srcdir/config.sub $target` || exit 1
  243.  
  244. # Decode the host machine, then the target machine.
  245. # For the host machine, we save the xm_file variable as host_xm_file;
  246. # then we decode the target machine and forget everything else
  247. # that came from the host machine.
  248. for machine in $canon_build $canon_host $canon_target; do
  249.  
  250.     cpu_type=
  251.     xm_file=
  252.     tm_file=
  253.     out_file=
  254.     xmake_file=
  255.     tmake_file=
  256.     header_files=
  257.     # Set this to force installation and use of collect2.
  258.     use_collect2=
  259.     # Set this to override the default target model.
  260.     target_cpu_default=
  261.     # Set this to force use of install.sh.
  262.     broken_install=
  263.     # Set this to control which fixincludes program to use.
  264.     fixincludes=fixincludes
  265.  
  266.     case $machine in
  267.     # Support site-specific machine types.
  268.     *local*)
  269.         cpu_type=$machine
  270.         xm_file=xm-$machine.h
  271.         tm_file=$machine.h
  272.         if [ -f $srcdir/config/x-$machine ] ; \
  273.         then xmake_file=x-$machine; \
  274.         else true; \
  275.         fi
  276.         if [ -f $srcdir/config/t-$machine ] ; \
  277.         then tmake_file=t-$machine; \
  278.         else true; \
  279.         fi
  280.         ;;
  281.     vax-*-bsd*)            # vaxen running BSD
  282.         tm_file=vax.h
  283.         use_collect2=yes
  284.         ;;
  285.     vax-*-ultrix*)            # vaxen running ultrix
  286.         tm_file=ultrix.h
  287.         use_collect2=yes
  288.         ;;
  289.     vax-*-vms*)            # vaxen running VMS
  290.         xm_file=xm-vax-vms.h
  291.         tm_file=vax-vms.h
  292.         ;;
  293.     vax-*-sysv*)            # vaxen running system V
  294.         xm_file=xm-vaxv.h
  295.         tm_file=vaxv.h
  296.         ;;
  297. # This hasn't been upgraded to GCC 2.
  298. #    tahoe-harris-*)            # Harris tahoe, using COFF.
  299. #        tm_file=harris.h
  300. #        ;;
  301. #    tahoe-*-bsd*)            # tahoe running BSD
  302. #        xm_file=xm-tahoe.h
  303. #        tm_file=tahoe.h
  304. #        ;;
  305.     i[34]86-*-osfrose*)        # 386 using OSF/rose
  306.         tm_file=i386rose.h
  307.         xmake_file=x-i386rose
  308.         tmake_file=t-i386rose
  309.         use_collect2=yes
  310.         ;;
  311.     i[34]86-sequent-bsd*)         # 80386 from Sequent
  312.         xm_file=xm-i386.h
  313.         use_collect2=yes
  314.         if [ x$gas = xyes ]
  315.         then
  316.             tm_file=seq386gas.h
  317.         else
  318.             tm_file=seq386.h
  319.         fi
  320.         ;;
  321.     i[34]86-*-bsd*)
  322.         xm_file=xm-i386.h
  323.         tm_file=i386bsd.h
  324. #        tmake_file=t-libc-ok
  325.         use_collect2=yes
  326.         ;;
  327.     i[34]86-*-mach*)
  328.         xm_file=xm-i386.h
  329.         tm_file=i386mach.h
  330. #        tmake_file=t-libc-ok
  331.         use_collect2=yes
  332.         ;;
  333.     i[34]86-*-sco3.2v4*)         # 80386 running SCO 3.2v4 system
  334.         xm_file=xm-i386sco.h
  335.         tm_file=i386sco4.h
  336.         xmake_file=x-i386s4
  337.         tmake_file=t-i386sco
  338.         fixincludes=fixinc.sco
  339.         broken_install=yes
  340.         ;;
  341.     i[34]86-*-sco*)             # 80386 running SCO system
  342.         xm_file=xm-i386sco.h
  343.         tm_file=i386sco.h
  344.         xmake_file=x-i386sco
  345.         tmake_file=t-i386sco
  346.         broken_install=yes
  347.         ;;
  348.     i[34]86-*-isc*)            # 80386 running ISC system
  349.         xm_file=xm-i386isc.h
  350.         xmake_file=x-i386isc
  351.                 if [ x$gas = xyes ]
  352.         then
  353.             tm_file=i386iscgas.h
  354.             tmake_file=t-i386iscgas
  355.         else
  356.             tm_file=i386isc.h
  357.             tmake_file=t-i386isc
  358.         fi
  359.         broken_install=yes
  360.         ;;
  361.     i[34]86-ibm-aix*)        # IBM PS/2 running AIX
  362.                 if [ x$gas = xyes ]
  363.         then
  364.             tm_file=aix386.h
  365.         else
  366.             tm_file=aix386ng.h
  367.             use_collect2=yes
  368.         fi
  369.         xm_file=xm-aix386.h
  370.         xmake_file=x-aix386
  371.         broken_install=yes
  372.         ;;
  373.     i386-sun-sunos*)        # Sun i386 roadrunner
  374.         xm_file=xm-sun386.h
  375.         tm_file=i386sun.h
  376.         use_collect2=yes
  377.         ;;
  378.     i[34]86-*-linux*)               # Intel 80386's running Linux
  379.         cpu_type=i386
  380.         xm_file=xm-linux.h
  381.         xmake_file=x-linux
  382.         tm_file=i386linux.h
  383.         broken_install=yes
  384.         ;;
  385.     i486-ncr-sysv4*)        # NCR 3000 - i486 running system V.4
  386.         cpu_type=i386
  387.         xm_file=xm-i38v4.h
  388.         xmake_file=x-ncr3000
  389.         tm_file=i386v4.h
  390.         tmake_file=t-svr4
  391.         ;;
  392.     i[34]86-*-sysv4*)        # Intel 80386's running system V.4
  393.         cpu_type=i386
  394.         xm_file=xm-i38v4.h
  395.         tm_file=i386v4.h
  396.         tmake_file=t-svr4
  397.         xmake_file=x-svr4
  398.         ;;
  399.     i[34]86-*-sysv*)        # Intel 80386's running system V
  400.         xm_file=xm-i386v.h
  401.         xmake_file=x-i386v
  402.         tmake_file=t-svr3
  403.         if [ x$gas = xyes ]
  404.         then
  405.             if [ x$stabs = xyes ]
  406.             then
  407.                 tm_file=i386gstabs.h
  408.             else
  409.                 tm_file=i386gas.h
  410.             fi
  411.         else
  412.             tm_file=i386v.h
  413.         fi
  414.         ;;
  415.     i860-*-mach*)
  416.         xm_file=xm-i860.h
  417.         tm_file=i860mach.h
  418.         tmake_file=t-libc-ok
  419.         ;;
  420.     i860-*-sysv3*)
  421.         xm_file=xm-i86v3.h
  422.         xmake_file=x-i860v3
  423.         tm_file=i860v3.h
  424.         tmake_file=t-svr3
  425.         ;;
  426.     i860-*-sysv4*)
  427.         xm_file=xm-i86v4.h
  428.         xmake_file=x-i860v4
  429.         tm_file=i860v4.h
  430.         tmake_file=t-svr4
  431.         ;;
  432.     i860-alliant-*)        # Alliant FX/2800
  433.         xm_file=xm-fx2800.h
  434.         xmake_file=x-fx2800
  435.         tm_file=fx2800.h
  436.         tmake_file=t-fx2800
  437.         ;;
  438.     i860-*-bsd*)
  439.         if [ x$gas = xyes ]
  440.         then
  441.             tm_file=i860bg.h
  442.         else
  443.             tm_file=i860b.h
  444.         fi
  445.         use_collect2=yes
  446.         ;;
  447.     sparc-tti-*)
  448.         tm_file=pbd.h
  449.         xm_file=xm-pbd.h
  450.         use_collect2=yes
  451.         ;;
  452.     elxsi-elxsi-*)
  453.         tm_file=elxsi.h
  454.         xm_file=xm-elxsi.h
  455.         use_collect2=yes
  456.         ;;
  457.     sparc-*-sunos4*)
  458.         tm_file=sparc.h
  459.         use_collect2=yes
  460.         ;;
  461.     sparc-*-sunos3*)
  462.         tm_file=sun4o3.h
  463.         use_collect2=yes
  464.         ;;
  465.     sparc-*-sysv4*)
  466.         xm_file=xm-spcv4.h
  467.         tm_file=sparcv4.h
  468.         tmake_file=t-svr4
  469.         xmake_file=x-sparcv4
  470.         ;;
  471.     sparc-*-solaris2* | sparc-*-sunos5*)
  472.         xm_file=xm-spc-sol2.h
  473.         tm_file=spc-sol2.h
  474.         tmake_file=t-sol2
  475.         xmake_file=x-sparcv4
  476.         fixincludes=fixinc.svr4
  477.         broken_install=yes
  478.         ;;
  479.     m68k-cbm-sysv4*)        # Commodore variant of V.4.
  480.         tm_file=amix.h
  481.         xm_file=xm-amix.h
  482.         xmake_file=x-amix
  483.         tmake_file=t-svr4
  484.         header_files=math-68881.h
  485.         ;;
  486.     m68k-*-sysv4*)            # Motorola m68k's running system V.4
  487.         tm_file=m68kv4.h
  488.         xm_file=xm-m68kv.h
  489.         tmake_file=t-svr4
  490.         header_files=math-68881.h
  491.         ;;
  492.     m68k-bull-sysv*)        # Bull DPX/2
  493.         if [ x$gas = xyes ]
  494.         then
  495.             tm_file=dpx2g.h
  496.         else
  497.             echo dpx2 supported only with GAS 1>&2
  498.             exit 1
  499.             tm_file=dpx2.h
  500.         fi
  501.         xm_file=xm-m68kv.h
  502.         xmake_file=x-dpx2
  503.         use_collect2=yes
  504.         header_files=math-68881.h
  505.         ;;
  506.     m68k-next-*)
  507.         tm_file=next.h
  508.         out_file=next.c
  509.         xm_file=xm-next.h
  510.         tmake_file=t-next
  511.         xmake_file=x-next
  512.         use_collect2=yes
  513.         header_files=math-68881.h
  514.         ;;
  515.     m68k-sun-sunos3*)
  516.         if [ x$nfp = xyes ]
  517.         then
  518.             tm_file=sun3n3.h
  519.         else
  520.             tm_file=sun3o3.h
  521.         fi
  522.         use_collect2=yes
  523.         header_files=math-68881.h
  524.         ;;
  525.     m68k-sun-sunos*)        # For SunOS 4 (the default).
  526.         if [ x$nfp = xyes ]
  527.         then
  528.             tm_file=sun3n.h
  529.         else
  530.             tm_file=sun3.h
  531.         fi
  532.         use_collect2=yes
  533.         header_files=math-68881.h
  534.         ;;
  535.     m68k-sun-mach*)
  536.         tm_file=sun3mach.h
  537.         use_collect2=yes
  538.         header_files=math-68881.h
  539.         ;;
  540.     m68k-tti-*)
  541.         tm_file=pbb.h
  542.         xm_file=xm-m68kv.h
  543.         use_collect2=yes
  544.         header_files=math-68881.h
  545.         ;;
  546.     m68k-hp-hpux*)    # HP 9000 series 300
  547.         xm_file=xm-hp320.h
  548.         if [ x$gas = xyes ]
  549.         then
  550.             xmake_file=x-hp320g
  551.             tmake_file=t-hp320g
  552.             tm_file=hp320g.h
  553.         else
  554.             xmake_file=x-hp320
  555.             tm_file=hp320.h
  556.         fi
  557.         broken_install=yes
  558.         use_collect2=yes
  559.         header_files=math-68881.h
  560.         ;;
  561.     m68k-hp-bsd*)            # HP 9000/3xx running Berkeley Unix
  562.         tm_file=hp3bsd.h
  563.         use_collect2=yes
  564.         header_files=math-68881.h
  565.         ;;
  566.     m68k-isi-bsd*)
  567.         if [ x$nfp = xyes ]
  568.         then
  569.             tm_file=isi-nfp.h
  570.         else
  571.             tm_file=isi.h
  572.         fi
  573.         use_collect2=yes
  574.         header_files=math-68881.h
  575.         ;;
  576.     m68k-sony-newsos3*)
  577.             xm_file=xm-m68k.h
  578.         if [ x$gas = xyes ]
  579.         then
  580.             tm_file=news3gas.h
  581.         else
  582.             tm_file=news3.h
  583.         fi
  584.         use_collect2=yes
  585.         header_files=math-68881.h
  586.         ;;
  587.     m68k-sony-bsd* | m68k-sony-newsos*)
  588.             xm_file=xm-m68k.h
  589.         if [ x$gas = xyes ]
  590.         then
  591.             tm_file=newsgas.h
  592.         else
  593.             tm_file=news.h
  594.         fi
  595.         use_collect2=yes
  596.         header_files=math-68881.h
  597.         ;;
  598.     m68k-altos-sysv*)           # Altos 3068
  599.         if [ x$gas = xyes ]
  600.         then
  601.                 xm_file=xm-altos3068.h
  602.                 tm_file=altos3068.h
  603.         else
  604.             echo "The Altos is supported only with the GNU assembler" 1>&2
  605.             exit 1
  606.         fi
  607.         header_files=math-68881.h
  608.             ;;
  609.     m68k-motorola-sysv*)
  610.         tm_file=mot3300.h
  611.         xm_file=xm-mot3300.h
  612.         use_collect2=yes
  613.         header_files=math-68881.h
  614.         ;;
  615.     m68k-crds-unos*)
  616.         xm_file=xm-crds.h
  617.         xmake_file=x-crds
  618.         tm_file=crds.h
  619.         broken_install=yes
  620.         use_collect2=yes
  621.         header_files=math-68881.h
  622.         ;;
  623.     m68k-apollo-*)
  624.         xmake_file=x-apollo68
  625.         tm_file=apollo68.h
  626.         use_collect2=yes
  627.         header_files=math-68881.h
  628.         ;;
  629.         m68k-plexus-sysv*)
  630.             cpu_type=m68k
  631.         tm_file=plexus.h
  632.         use_collect2=yes
  633.         xm_file=xm-plexus.h
  634.         header_files=math-68881.h
  635.         ;;
  636.     m68k-ncr-sysv*)            # NCR Tower 32 SVR3
  637.         tm_file=tower-as.h
  638.         xm_file=xm-tower.h
  639.         xmake_file=x-tower
  640.         tmake_file=t-svr3
  641.         header_files=math-68881.h
  642.         ;;
  643.     m68k-*-sysv3*)            # Motorola m68k's running system V.3
  644.         tm_file=m68k.h
  645.         xm_file=xm-m68kv.h
  646.         xmake_file=x-m68kv
  647.         tmake_file=t-svr3
  648.         header_files=math-68881.h
  649.         ;;
  650.     m68k-apple-mpw*)        # Apple Macintosh MacOS with MPW
  651.         cpu_type=m68k
  652.         tm_file=mac.h
  653.         out_file=m68k.c
  654.         xm_file=xm-mpw.h
  655.         tmake_file=t-apple
  656.         ;;
  657.     m68k-apple-sysv)        # Apple Macintosh running A/UX
  658.         xm_file=xm-aux.h
  659.         tm_file=aux.h
  660.         ;;
  661.     m68000-sun-sunos3*)
  662.         cpu_type=m68k
  663.         tm_file=sun2.h
  664.         use_collect2=yes
  665.         header_files=math-68881.h
  666.         ;;
  667.     m68000-sun-sunos4*)
  668.         cpu_type=m68k
  669.         tm_file=sun2o4.h
  670.         use_collect2=yes
  671.         header_files=math-68881.h
  672.         ;;
  673.     m68000-hp-hpux*)        # HP 9000 series 300
  674.         cpu_type=m68k
  675.         xm_file=xm-hp320.h
  676.         if [ x$gas = xyes ]
  677.         then
  678.             xmake_file=x-hp320g
  679.             tm_file=hp310g.h
  680.         else
  681.             xmake_file=x-hp320
  682.             tm_file=hp310.h
  683.         fi
  684.         broken_install=yes
  685.         use_collect2=yes
  686.         header_files=math-68881.h
  687.         ;;
  688.     m68000-hp-bsd*)            # HP 9000/200 running BSD
  689.         cpu_type=m68k
  690.         tm_file=hp2bsd.h
  691.         xmake_file=x-hp2bsd
  692.         use_collect2=yes
  693.         header_files=math-68881.h
  694.         ;;
  695.     m68000-att-sysv*)
  696.         cpu_type=m68k
  697.         xm_file=xm-3b1.h
  698.         if [ x$gas = xyes ]
  699.         then
  700.             tm_file=3b1g.h
  701.         else
  702.             tm_file=3b1.h
  703.         fi
  704.         use_collect2=yes
  705.         header_files=math-68881.h
  706.         ;;
  707.     m68000-convergent-sysv*)
  708.         cpu_type=m68k
  709.         xm_file=xm-3b1.h
  710.         tm_file=ctix.h
  711.         use_collect2=yes
  712.         header_files=math-68881.h
  713.         ;;
  714.     ns32k-encore-osf*)        # Encore with OSF/rose
  715.         tm_file=encrose.h
  716.         xmake_file=x-encrose
  717.         tmake_file=t-encrose
  718.         use_collect2=yes
  719.         ;;
  720.     ns32k-sequent-bsd*)
  721.         tm_file=sequent.h
  722.         use_collect2=yes
  723.         ;;
  724.     ns32k-encore-bsd*)
  725.         tm_file=encore.h
  726.         use_collect2=yes
  727.         ;;
  728. # This has not been updated to GCC 2.
  729. #    ns32k-ns-genix*)
  730. #        xm_file=xm-genix.h
  731. #        xmake_file=x-genix
  732. #        tm_file=genix.h
  733. #        broken_install=yes
  734. #        use_collect2=yes
  735. #        ;;
  736.     ns32k-merlin-*)
  737.         tm_file=merlin.h
  738.         use_collect2=yes
  739.         ;;
  740.     ns32k-tek6100-bsd*)
  741.         tm_file=tek6100.h
  742.         broken_install=yes
  743.         use_collect2=yes
  744.         ;;
  745.     ns32k-tek6200-bsd*)
  746.         tm_file=tek6200.h
  747.         broken_install=yes
  748.         use_collect2=yes
  749.         ;;
  750.     ns32k-pc532-mach*)
  751.         tm_file=pc532-mach.h
  752.         use_collect2=yes
  753.         ;;
  754.     ns32k-pc532-minix*)
  755.         tm_file=pc532-min.h
  756.         xm_file=xm-pc532-min.h
  757.         use_collect2=yes
  758.         ;;
  759.     m88k-*-luna*)
  760.         tm_file=m88kluna.h
  761.         tmake_file=t-m88kluna
  762.         ;;
  763.     m88k-dg-dgux*)
  764.         tm_file=m88kdgux.h
  765.         xmake_file=x-m88kdgux
  766.         broken_install=yes
  767.         ;;
  768.     m88k-*-sysv4*)
  769.         tm_file=m88kv4.h
  770.         xmake_file=x-m88kv4
  771.         tmake_file=t-m88kv4
  772.         ;;
  773.     m88k-dolphin-sysv3*)
  774.         tm_file=m88kdolph.h
  775.         xm_file=xm-m88kv3.h
  776.         xmake_file=x-m88kdolph
  777.         ;;
  778.     m88k-*-sysv3*)
  779.         tm_file=m88kv3.h
  780.         xm_file=xm-m88kv3.h
  781.         ;;
  782. # This hasn't been upgraded to GCC 2.
  783. #    fx80-alliant-*)            # Alliant FX/80
  784. #        tm_file=fx80.h
  785. #        ;;
  786.     arm-*-*)            # Acorn RISC machine
  787.         tm_file=arm.h
  788.         ;;
  789.     c1-convex-*)            # Convex C1
  790.         tm_file=convex1.h
  791.         cpu_type=convex
  792.         use_collect2=yes
  793.         ;;
  794.     c2-convex-*)            # Convex C2
  795.         tm_file=convex2.h
  796.         cpu_type=convex
  797.         use_collect2=yes
  798.         ;;
  799.     c32-convex-*)
  800.         tm_file=convex32.h    # Convex C32xx
  801.         cpu_type=convex
  802.         use_collect2=yes
  803.         ;;
  804.     c34-convex-*)
  805.         tm_file=convex34.h    # Convex C34xx
  806.         cpu_type=convex
  807.         use_collect2=yes
  808.         ;;
  809.     c38-convex-*)
  810.         tm_file=convex38.h    # Convex C38xx
  811.         cpu_type=convex
  812.         use_collect2=yes
  813.         ;;
  814.     mips-sgi-irix4*)        # Mostly like a MIPS.
  815.         if [ x$stabs = xyes ]; then
  816.             tm_file=iris4g.h
  817.         else
  818.             tm_file=iris4.h
  819.         fi
  820.         xm_file=xm-irix4.h
  821.         broken_install=yes
  822.         xmake_file=x-iris
  823.         use_collect2=yes
  824.         ;;
  825.     mips-sgi-*)            # Mostly like a MIPS.
  826.         if [ x$stabs = xyes ]; then
  827.             tm_file=irisgdb.h
  828.         else
  829.             tm_file=iris.h
  830.         fi
  831.         xm_file=xm-iris.h
  832.         broken_install=yes
  833.         xmake_file=x-iris
  834.         use_collect2=yes
  835.         ;;
  836.     mips-dec-ultrix*)        # Decstation.
  837.         if [ x$stabs = xyes ]; then
  838.             tm_file=decstabs.h
  839.         else
  840.             tm_file=decstatn.h
  841.         fi
  842.         tmake_file=t-decstatn
  843.         xmake_file=x-decstatn
  844.         use_collect2=yes
  845.             ;;
  846.     mips-dec-osfrose*)        # Decstation running OSF/1 reference port with OSF/rose.
  847.         tm_file=decrose.h
  848.         xmake_file=x-decrose
  849.         tmake_file=t-decrose
  850.         use_collect2=yes
  851.         ;;
  852.     mips-dec-osf*)            # Decstation running OSF/1 as shipped by DIGITAL
  853.         if [ x$stabs = xyes ]; then
  854.             tm_file=dec-gosf1.h
  855.         else
  856.             tm_file=dec-osf1.h
  857.         fi
  858.         xmake_file=x-dec-osf1
  859.         tmake_file=t-decstatn
  860.         use_collect2=yes
  861.         ;;
  862.     mips-sony-bsd* | mips-sony-newsos*)    # Sony NEWS 3600 or risc/news.
  863.         if [ x$stabs = xyes ]; then
  864.             tm_file=mips-gnews.h
  865.         else
  866.             tm_file=mips-news.h
  867.         fi
  868.         xm_file=xm-mips.h
  869.         use_collect2=yes
  870.         ;;
  871.     mips-sony-sysv*)        # Sony NEWS 3800 with NEWSOS5.0.
  872.                     # That is based on svr4.
  873.         # t-svr4 is not right because this system doesn't use ELF.
  874.         if [ x$stabs = xyes ]; then
  875.             tm_file=mips-gn5.h
  876.         else
  877.             tm_file=mips-n5.h
  878.         fi
  879.         xm_file=xm-mipsnews.h
  880.         use_collect2=yes
  881.         ;;
  882.     mips-*riscos[56789]bsd* | mips-*riscos[56789]-bsd*)
  883.         if [ x$stabs = xyes ]; then    # MIPS BSD 4.3, RISC-OS 5.0
  884.             tm_file=mips-5gbsd.h
  885.         else
  886.             tm_file=mips-5bsd.h
  887.         fi
  888.         use_collect2=yes
  889.             ;;
  890.     mips-*-bsd* | mips-*riscosbsd* | mips-*riscos[1234]bsd* \
  891.         | mips-*riscos-bsd* | mips-*riscos[1234]-bsd*)
  892.         if [ x$stabs = xyes ]; then    # MIPS BSD 4.3, RISC-OS 4.0
  893.             tm_file=mips-gbsd.h
  894.         else
  895.             tm_file=mips-bsd.h
  896.         fi
  897.         use_collect2=yes
  898.             ;;
  899.     mips-*riscos[56789]sysv4* | mips-*riscos[56789]-sysv4*)
  900.         if [ x$stabs = xyes ]; then    # MIPS System V.4., RISC-OS 5.0
  901.             tm_file=mips-5gsvr4.h
  902.         else
  903.             tm_file=mips-5svr4.h
  904.         fi
  905.         xm_file=xm-umips.h
  906.         xmake_file=x-mipsv
  907.         ;;
  908.     mips-*-sysv4* | mips-*riscos[1234]sysv4* | mips-*riscossysv4* \
  909.         | mips-*riscos[1234]-sysv4* | mips-*riscos-sysv4*)
  910.         if [ x$stabs = xyes ]; then    # MIPS System V.4. RISC-OS 4.0
  911.             tm_file=mips-gsvr4.h
  912.         else
  913.             tm_file=mips-svr4.h
  914.         fi
  915.         xm_file=xm-umips.h
  916.         xmake_file=x-mipsv
  917.         ;;
  918.     mips-*riscos[56789]sysv* | mips-*-riscos[56788]-sysv*)
  919.         if [ x$stabs = xyes ]; then    # MIPS System V.3, RISC-OS 5.0
  920.             tm_file=mips-5gsysv.h
  921.         else
  922.             tm_file=mips-5sysv.h
  923.         fi
  924.         xm_file=xm-umips.h
  925.         xmake_file=x-mipsv
  926.         use_collect2=yes
  927.         ;;
  928.     mips-*-sysv* | mips-*riscossysv* | mips-*riscos-sysv*)
  929.         if [ x$stabs = xyes ]; then    # MIPS System V.3, RISC-OS 4.0
  930.             tm_file=mips-gsysv.h
  931.         else
  932.             tm_file=mips-sysv.h
  933.         fi
  934.         xm_file=xm-umips.h
  935.         xmake_file=x-mipsv
  936.         use_collect2=yes
  937.         ;;
  938.     mips-*riscos[56789]*)            # Default MIPS RISC-OS 5.0.
  939.         if [ x$stabs = xyes ]; then
  940.             tm_file=mips-5gdb.h
  941.         else
  942.             tm_file=mips-5.h
  943.         fi
  944.         use_collect2=yes
  945.         ;;
  946.     mips-*-*)                # Default MIPS RISC-OS 4.0.
  947.         if [ x$stabs = xyes ]; then
  948.             tm_file=mips-gdb.h
  949.         else
  950.             tm_file=mips.h
  951.         fi
  952.         use_collect2=yes
  953.         ;;
  954.     pyramid-*-*)
  955.         cpu_type=pyr
  956.         tm_file=pyr.h
  957.         use_collect2=yes
  958.         ;;
  959. # This hasn't been upgraded to GCC 2.
  960. #    tron-*-*)
  961. #        cpu_type=gmicro
  962. #        tm_file=gmicro.h
  963. #        use_collect2=yes
  964. #        ;;
  965.     a29k-*-bsd*)
  966.         tm_file=a29kunix.h
  967.         xm_file=xm-a29kunix.h
  968.         xmake_file=x-a29kunix
  969.         use_collect2=yes
  970.         ;;
  971.     a29k-*-*)            # Default a29k environment.
  972.         use_collect2=yes
  973.         ;;
  974.     romp-*-aos*)
  975.         xm_file=xm-romp.h
  976.         tm_file=romp.h
  977.         use_collect2=yes
  978.         ;;
  979.     romp-*-mach*)
  980.         xm_file=xm-romp.h
  981.         tm_file=romp.h
  982.         xmake_file=x-romp-mach
  983.         use_collect2=yes
  984.         ;;
  985.     rs6000-*-mach*)
  986.         xm_file=xm-rs6k-m.h
  987.         tm_file=rs6000-mach.h
  988.         xmake_file=x-rs6k-mach
  989.         use_collect2=yes
  990.         ;;
  991.     rs6000-ibm-aix32)
  992.         xm_file=xm-rs6000.h
  993.         tm_file=rs6000-aix32.h
  994.         use_collect2=yes
  995.         ;;
  996.     rs6000-ibm-aix*)
  997.         xm_file=xm-rs6000.h
  998.         tm_file=rs6000.h
  999.         use_collect2=yes
  1000.         ;;
  1001.     hppa1.1-*-bsd*)
  1002.         cpu_type=pa
  1003.         xm_file=xm-pa.h
  1004.         tm_file=pa1.h
  1005.         xmake_file=x-pa
  1006.         tmake_file=t-pa
  1007.         use_collect2=yes
  1008.         ;;
  1009.     hppa1.0-*-bsd*)
  1010.         cpu_type=pa
  1011.         xm_file=xm-pa.h
  1012.         tm_file=pa.h
  1013.         xmake_file=x-pa
  1014.         tmake_file=t-pa
  1015.         use_collect2=yes
  1016.         ;;
  1017.     hppa1.0-*-hpux7*)
  1018.         cpu_type=pa
  1019.         xm_file=xm-pahpux.h
  1020.         xmake_file=x-pa-hpux
  1021.         tmake_file=t-libc-ok
  1022.         if [ x$gas = xyes ]
  1023.         then
  1024.             tm_file=pa-gux7.h
  1025.         else
  1026.             tm_file=pa-hpux7.h
  1027.         fi
  1028.         broken_install=yes
  1029.         use_collect2=yes
  1030.         ;;
  1031.     hppa1.1-*-hpux*)
  1032.         cpu_type=pa
  1033.         xm_file=xm-pahpux.h
  1034.         xmake_file=x-pa-hpux
  1035.         tmake_file=t-libc-ok
  1036.         if [ x$gas = xyes ]
  1037.         then
  1038.             tm_file=pa1-ghpux.h
  1039.         else
  1040.             tm_file=pa1-hpux.h
  1041.         fi
  1042.         broken_install=yes
  1043.         use_collect2=yes
  1044.         ;;
  1045.     hppa1.0-*-hpux*)
  1046.         cpu_type=pa
  1047.         xm_file=xm-pahpux.h
  1048.         xmake_file=x-pa-hpux
  1049.         tmake_file=t-libc-ok
  1050.         if [ x$gas = xyes ]
  1051.         then
  1052.             tm_file=pa-ghpux.h
  1053.         else
  1054.             tm_file=pa-hpux.h
  1055.         fi
  1056.         broken_install=yes
  1057.         use_collect2=yes
  1058.         ;;
  1059.     we32k-att-sysv*)
  1060.         cpu_type=we32k
  1061.         use_collect2=yes
  1062.         ;;
  1063.     alpha-*-osf*)
  1064.         cpu_type=alpha
  1065.         broken_install=yes
  1066.         use_collect2=yes
  1067.         ;;
  1068.     i960-*-*)            # Default i960 environment.
  1069.         use_collect2=yes
  1070.         ;;
  1071.     *)
  1072.         echo "Configuration $machine not supported" 1>&2
  1073.         exit 1
  1074.         ;;
  1075.     esac
  1076.  
  1077.     case $machine in
  1078.     *-*-sysv4*)
  1079.         fixincludes=fixinc.svr4
  1080.         xmake_try_sysv=x-sysv
  1081.         broken_install=yes
  1082.         ;;
  1083.     *-*-sysv*)
  1084.         broken_install=yes
  1085.         ;;
  1086.     esac
  1087.  
  1088.     # Distinguish i386 from i486.
  1089.     case $machine in
  1090.     i486-*-*)
  1091.         target_cpu_default=2
  1092.         ;;
  1093.     esac
  1094.  
  1095.     # No need for collect2 if we have the GNU linker.
  1096.     case x$gnu_ld in 
  1097.     xyes)
  1098.         use_collect2=
  1099.         ;;
  1100.     esac
  1101.  
  1102. # Default certain vars that apply to both host and target in turn.
  1103.     if [ x$cpu_type = x ]
  1104.     then cpu_type=`echo $machine | sed 's/-.*$//'`
  1105.     fi
  1106.  
  1107. # Save data on machine being used to compile GCC in build_xm_file.
  1108. # Save data on host machine in vars host_xm_file and host_xmake_file.
  1109.     if [ x$pass1done = x ]
  1110.     then
  1111.         if [ x$xm_file = x ]; then build_xm_file=xm-$cpu_type.h
  1112.         else build_xm_file=$xm_file
  1113.         fi
  1114.         pass1done=yes
  1115.     else
  1116.         if [ x$pass2done = x ]
  1117.         then
  1118.             if [ x$xm_file = x ]; then host_xm_file=xm-$cpu_type.h
  1119.             else host_xm_file=$xm_file
  1120.             fi
  1121.             if [ x$xmake_file = x ]
  1122.             then xmake_file=x-$cpu_type
  1123.             fi
  1124.             host_xmake_file=$xmake_file
  1125.             host_broken_install=$broken_install
  1126.             pass2done=yes
  1127.         fi
  1128.     fi
  1129. done
  1130.  
  1131. # Default the target-machine variables that were not explicitly set.
  1132. if [ x$tm_file = x ]
  1133. then tm_file=$cpu_type.h; fi
  1134.  
  1135. if [ x$header_files = x ]
  1136. then header_files=; fi
  1137.  
  1138. if [ x$xm_file = x ]
  1139. then xm_file=xm-$cpu_type.h; fi
  1140.  
  1141. md_file=${cpu_type}.md
  1142.  
  1143. if [ x$out_file = x ]
  1144. then out_file=$cpu_type.c; fi
  1145.  
  1146. if [ x$tmake_file = x ]
  1147. then tmake_file=t-$cpu_type
  1148. fi
  1149.  
  1150.  
  1151. # Set up the list of links to be made.
  1152. # $links is the list of link names, and $files is the list of names to link to.
  1153. files="$host_xm_file $tm_file $md_file $out_file $xm_file $build_xm_file"
  1154. links="config.h tm.h md aux-output.c tconfig.h hconfig.h"
  1155.  
  1156. # Make the links.
  1157. while [ -n "$files" ]
  1158. do
  1159.     # set file to car of files, files to cdr of files
  1160.     set $files; file=$1; shift; files=$*
  1161.     set $links; link=$1; shift; links=$*
  1162.  
  1163.     if [ ! -r ${srcdir}/config/$file ]
  1164.     then
  1165.         echo "$progname: cannot create a link \`$link'," 1>&2
  1166.         echo "since the file \`config/$file' does not exist" 1>&2
  1167.         exit 1
  1168.     fi
  1169.  
  1170.     $remove -f $link
  1171.     rm -f config.status
  1172.     # Make a symlink if possible, otherwise try a hard link
  1173.     $symbolic_link ${srcdir}/config/$file $link 2>/dev/null || $hard_link ${srcdir}/config/$file $link || $copy ${srcdir}/config/$file $link
  1174.  
  1175.     if [ ! -r $link ]
  1176.     then
  1177.         echo "$progname: unable to link \`$link' to \`${srcdir}/config/$file'" 1>&2
  1178.         exit 1
  1179.     fi
  1180.     echo "Linked \`$link' to \`${srcdir}/config/$file'"
  1181. done
  1182.  
  1183. # Create Makefile.tem from Makefile.in.
  1184. # Make it set VPATH if necessary so that the sources are found.
  1185. # Also change its value of srcdir.
  1186. # Also create a .gdbinit file which runs the one in srcdir
  1187. # and tells GDB to look there for source files.
  1188. case $srcdir in
  1189. .)
  1190.     rm -f Makefile.tem
  1191.     cp Makefile.in Makefile.tem
  1192.     chmod +w Makefile.tem
  1193.     ;;
  1194. *)
  1195.     rm -f Makefile.tem
  1196.     echo "VPATH = ${srcdir}" \
  1197.       | cat - ${srcdir}/Makefile.in \
  1198.       | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.tem
  1199.     rm -f .gdbinit
  1200.     echo "dir ." > .gdbinit
  1201.     echo "dir ${srcdir}" >> .gdbinit
  1202.     echo "source ${srcdir}/.gdbinit" >> .gdbinit
  1203.     ;;
  1204. esac
  1205.  
  1206. # Conditionalize the makefile for this host machine.
  1207. if [ -f ${srcdir}/config/${host_xmake_file} ]
  1208. then
  1209.     rm -f Makefile.xx
  1210.     sed -e "/####host/  r ${srcdir}/config/${host_xmake_file}" Makefile.tem > Makefile.xx
  1211.     echo "Merged ${host_xmake_file}."
  1212.     rm -f Makefile.tem
  1213.     mv Makefile.xx Makefile.tem
  1214. else
  1215. # Say in the makefile that there is no host_xmake_file,
  1216. # by using a name which (when interpreted relative to $srcdir/config)
  1217. # will duplicate another dependency: $srcdir/Makefile.in.
  1218.     host_xmake_file=../Makefile.in
  1219. fi
  1220.  
  1221. # Add a definition for INSTALL if system wants one.
  1222. # This substitutes for lots of x-* files.
  1223. if [ x$host_broken_install = x ]
  1224. then true
  1225. else
  1226.     rm -f Makefile.xx
  1227.     abssrcdir=`cd ${srcdir}; pwd`
  1228.     sed "s|^INSTALL = .*|INSTALL = ${abssrcdir}/install.sh -c|" Makefile.tem > Makefile.xx
  1229.     rm -f Makefile.tem
  1230.     mv Makefile.xx Makefile.tem
  1231. fi
  1232.  
  1233. # Set EXTRA_HEADERS according to header_files.
  1234. # This substitutes for lots of t-* files.
  1235. if [ x$header_files = x ]
  1236. then true
  1237. else
  1238.     rm -f Makefile.xx
  1239.     sed "s/^EXTRA_HEADERS =/EXTRA_HEADERS = $header_files/" Makefile.tem > Makefile.xx
  1240.     rm -f Makefile.tem
  1241.     mv Makefile.xx Makefile.tem
  1242. fi
  1243.  
  1244. # Add a definition of USE_COLLECT2 if system wants one.
  1245. # Also tell toplev.c what to do.
  1246. # This substitutes for lots of t-* files.
  1247. if [ x$use_collect2 = x ]
  1248. then true
  1249. else
  1250.     rm -f Makefile.xx
  1251.     (echo "USE_COLLECT2 = ld"; echo "MAYBE_USE_COLLECT2 = -DUSE_COLLECT2")\
  1252.         | cat - Makefile.tem > Makefile.xx
  1253.     rm -f Makefile.tem
  1254.     mv Makefile.xx Makefile.tem
  1255. fi
  1256.  
  1257. # Add -DTARGET_CPU_DEFAULT for toplev.c if system wants one.
  1258. # This substitutes for lots of *.h files.
  1259. if [ x$target_cpu_default = x ]
  1260. then true
  1261. else
  1262.     rm -f Makefile.xx
  1263.     (echo "MAYBE_TARGET_DEFAULT = -DTARGET_CPU_DEFAULT=$target_cpu_default")\
  1264.         | cat - Makefile.tem > Makefile.xx
  1265.     rm -f Makefile.tem
  1266.     mv Makefile.xx Makefile.tem
  1267. fi
  1268.  
  1269. # Conditionalize the makefile for this target machine.
  1270. if [ -f ${srcdir}/config/${tmake_file} ]
  1271. then
  1272.     rm -f Makefile.xx
  1273.     sed -e "/####target/  r ${srcdir}/config/${tmake_file}" Makefile.tem > Makefile.xx
  1274.     echo "Merged ${tmake_file}."
  1275.     rm -f Makefile.tem
  1276.     mv Makefile.xx Makefile.tem
  1277. else
  1278. # Say in the makefile that there is no tmake_file,
  1279. # by using a name which (when interpreted relative to $srcdir/config)
  1280. # will duplicate another dependency: $srcdir/Makefile.in.
  1281.     tmake_file=../Makefile.in
  1282. fi
  1283.  
  1284. # Remove all formfeeds, since some Makes get confused by them.
  1285. # Also arrange to give the variables `target', `host_xmake_file',
  1286. # `tmake_file', `prefix', `exec_prefix' and `FIXINCLUDES'
  1287. # values in the Makefile from the values they have in this script.
  1288. rm -f Makefile.xx
  1289. sed -e "s/ //" -e "s/^target=.*$/target=${target}/" \
  1290.     -e "s|^xmake_file=.*$|xmake_file=${host_xmake_file}|" \
  1291.     -e "s|^tmake_file=.*$|tmake_file=${tmake_file}|" \
  1292.     -e "s|^prefix[     ]*=.*|prefix = $prefix|" \
  1293.     -e "s|^exec_prefix[     ]*=.*|exec_prefix = $exec_prefix|" \
  1294.     -e "s|^FIXINCLUDES[     ]*=.*|FIXINCLUDES = $fixincludes|" \
  1295.     Makefile.tem > Makefile.xx
  1296. rm -f Makefile.tem
  1297. mv Makefile.xx Makefile.tem
  1298.  
  1299. # Install Makefile for real, after making final changes.
  1300. # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
  1301. # Also use all.cross instead of all.internal, and add cross-make to Makefile.
  1302. if [ x$host = x$target ]
  1303. then
  1304.     rm -f Makefile
  1305.       if [ x$host = x$build ]
  1306.     then
  1307.         mv Makefile.tem Makefile
  1308.     else
  1309. #        When build gcc with cross-compiler, we need to fix a
  1310. #        few things.
  1311.         echo "build= $build" > Makefile
  1312.         sed -e "/####build/  r ${srcdir}/build-make" Makefile.tem >> Makefile
  1313.         rm -f Makefile.tem Makefile.xx
  1314.     fi
  1315. else
  1316.     rm -f Makefile
  1317.     echo "CROSS=-DCROSS_COMPILE" > Makefile
  1318.     sed -e "/####cross/  r ${srcdir}/cross-make" Makefile.tem >> Makefile
  1319.     rm -f Makefile.tem Makefile.xx
  1320. fi
  1321.  
  1322. echo "Created \`Makefile'."
  1323.  
  1324. if [ xx${vint} != xx ]
  1325. then
  1326.     vintmsg=" (vint)"
  1327. fi
  1328.  
  1329. # Describe the chosen configuration in config.status.
  1330. # Make that file a shellscript which will reestablish the same configuration.
  1331. echo "#!/bin/sh
  1332. # GCC was configured as follows:
  1333. ${srcdir}/configure" $arguments > config.status
  1334. echo echo host=$canon_host target=$canon_target build=$canon_build >> config.status
  1335. chmod a+x config.status
  1336.  
  1337. if [ x$canon_host = x$canon_target ]
  1338. then
  1339.     echo "Links are now set up for target $canon_target."
  1340. else
  1341.     echo "Links are now set up for host $canon_host and target $canon_target."
  1342. fi
  1343.  
  1344. exit 0
  1345.